package com.robot.vo;

import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * User: li
 * Date: 2019/6/16
 * Time: 11:13
 * PROJECT：robot
 * PACKAGE: com.robot
 *
 * @author:55324936@qq.com To change this template use File | Settings | File Templates.
 */
@Data
public class ResponseMessage<T> {
    private String msg;
    private boolean success;
    private Integer code;
    private T data;
    ResponseMessage(boolean success,String msg,Integer code,T data){
        this.success=success;
        this.msg=msg;
        this.data=data;
        this.code=code;
    }
    public static ResponseMessage successResponse(){
        return new ResponseMessage(Boolean.TRUE,null,200,null);
    }
    public static ResponseMessage successResponse(Object data){
        return new ResponseMessage(Boolean.TRUE,null,200,data);
    }
    public static ResponseMessage errorResponse(String msg){
        return new ResponseMessage(Boolean.FALSE,msg,200,null);
    }
}
